home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / MM3Tp.sea Folder / Made by Marksman / Sources / u / Floating_window.p < prev    next >
Text File  |  1994-01-16  |  6KB  |  267 lines

  1.  
  2. unit UFloating_window;
  3. {  Floating_window                                 Handle this Window }
  4. {  Copyright © 1994 George R. Cossey }
  5.  
  6.     File name: Floating_window
  7.     Function: Handle a Window 
  8.     History: 1/16/94 Original by George Cossey
  9.  
  10. }
  11.  
  12. interface
  13.  
  14.     uses
  15.         Printing,Folders,Sound,mmCommonMM_Demo,CommonMM_Demo;
  16.  
  17.  
  18. { ======================================================= }
  19. { ======================================================= }
  20.  
  21. procedure U_InitFloating_windowRec(theWS:Floating_windowPRec);
  22.  
  23. { Initialize us so all our routines can be activated }
  24. procedure U_InitFloating_window;
  25.  
  26. { Close our window }
  27. procedure U_CloseFloating_window(theWS:Floating_windowPRec);
  28.  
  29. { Handle resizing scrollbars }
  30. procedure U_ResizedFloating_window(theWS:Floating_windowPRec;OldRect:Rect);
  31.  
  32. { Our window was moved }
  33. procedure U_MovedFloating_window(OldRect:Rect;whichWindow:WindowPtr);
  34.  
  35. { Update our window, someone uncovered a part of us }
  36. procedure U_UpdateFloating_window(theWS:Floating_windowPRec);
  37.  
  38. { Open our window and draw everything }
  39. procedure U_OpenFloating_window(theWS:Floating_windowPRec);
  40.  
  41. { Handle activation of our window }
  42. procedure U_ActivateFloating_window(theWS:Floating_windowPRec;Do_An_Activate:Boolean);
  43.  
  44. { Handle action to our window, like controls }
  45. procedure U_DoButtonFloating_window(theWS:Floating_windowPRec;RefCon:longint;theControl:ControlHandle;var UnHiliteValue:integer);
  46.  
  47. { Handle any special window events }
  48. procedure U_DoEventFloating_window(theWS:Floating_windowPRec;var myEvent:EventRecord);
  49.  
  50. { ======================================================= }
  51. { ======================================================= }
  52.  
  53. implementation
  54.  
  55. { ======================================================= }
  56. { ======================================================= }
  57.  
  58. procedure U_InitFloating_windowRec(theWS:Floating_windowPRec);
  59.  
  60.  
  61. begin
  62. end;
  63.  
  64. { ======================================================= }
  65.  
  66. { Routine: U_InitFloating_window }
  67. { Purpose: Initialize our window data to not in use yet }
  68.  
  69. procedure U_InitFloating_window;
  70.  
  71.  
  72. begin
  73. end;
  74.  
  75. { ======================================================= }
  76.  
  77. { Routine: U_CloseFloating_window }
  78. { Purpose: Close out the window }
  79.  
  80. procedure U_CloseFloating_window(theWS:Floating_windowPRec);
  81.  
  82.  
  83. begin
  84. end;
  85.  
  86. { ======================================================= }
  87.  
  88. { Routine: U_ResizedFloating_window }
  89. { Purpose: We were resized or zoomed, update the scrolling scrollbars }
  90. { OldRect is the size of the window before the resize }
  91.  
  92. procedure U_ResizedFloating_window(theWS:Floating_windowPRec;OldRect:Rect);
  93.  
  94.  
  95. begin
  96. end;
  97.  
  98. { ======================================================= }
  99.  
  100. { Routine: U_MovedFloating_window }
  101. { Purpose: We were moved, possibly to another screen and screen depth }
  102. { OldRect is the size of the window before the resize }
  103.  
  104. procedure U_MovedFloating_window(OldRect:Rect;whichWindow:WindowPtr);
  105.  
  106.  
  107. begin
  108. end;
  109.  
  110. { ======================================================= }
  111.  
  112. { Routine: U_UpDateFloating_window }
  113. { Purpose: Update our window }
  114. { User can place code before or after the DrawControls }
  115.  
  116. procedure U_UpdateFloating_window(theWS:Floating_windowPRec);
  117.  
  118.  
  119. begin
  120. DrawControls(theWS^.theWindow);                        { Draw all the controls }
  121. end;
  122.  
  123. { ======================================================= }
  124.  
  125. { Routine: U_OpenFloating_window }
  126. { Purpose: Open our window }
  127.  
  128. procedure U_OpenFloating_window(theWS:Floating_windowPRec);
  129.  
  130.  
  131. begin
  132.  
  133. if ((theWS <> nil) and (theWS^.theWindow <> nil)) then    {  See if opened OK }
  134.     begin
  135.     end;
  136. end;
  137.  
  138. { ======================================================= }
  139.  
  140. { Routine: U_ActivateFloating_window }
  141. { Purpose: We activated or deactivated }
  142.  
  143. procedure U_ActivateFloating_window(theWS:Floating_windowPRec;Do_An_Activate:Boolean);
  144.  
  145.  
  146. begin
  147. if (Do_An_Activate) then                                { Handle the activate }
  148.     begin
  149.     end
  150. else
  151.     begin
  152.     end;
  153. end;
  154.  
  155. { ======================================================= }
  156.  
  157. { Routine: U_DoButtonFloating_window }
  158. { Purpose: Handle extra buttons in our window }
  159.  
  160. {      RefCon = The RefCon of the button that was pressed }
  161. {      theControl = The ControlHandle of the button that was pressed }
  162. {      UnHiliteValue = 0 for unhilite, we can change that }
  163. procedure U_DoButtonFloating_window(theWS:Floating_windowPRec;RefCon:longint;theControl:ControlHandle;var UnHiliteValue:integer);
  164. var
  165.     theSelection:integer;                                { For palette and popup selections }
  166.  
  167.  
  168. begin
  169. case (RefCon) of                                    { Select correct button }
  170.     -1:begin end;
  171.     ResC_Tool_palette2:                { Palette, Tool palette  }
  172.         begin
  173.         theSelection := GetCtlValue(theWS^.Ctrl_Tool_palette2);{ Get the palette value, 0xrrcc, rr is row, cc is column }
  174.         theWS^.Value_Tool_palette2 := theSelection;    { Get the palette value }
  175.         case (theSelection)    of                { Select correct item }
  176.             -1:begin end;
  177.             257:            {  Row 1, Column 1 }
  178.                 begin
  179.                 end;
  180.             258:            {  Row 1, Column 2 }
  181.                 begin
  182.                 end;
  183.             513:            {  Row 2, Column 1 }
  184.                 begin
  185.                 end;
  186.             514:            {  Row 2, Column 2 }
  187.                 begin
  188.                 end;
  189.             769:            {  Row 3, Column 1 }
  190.                 begin
  191.                 end;
  192.             770:            {  Row 3, Column 2 }
  193.                 begin
  194.                 end;
  195.             1025:            {  Row 4, Column 1 }
  196.                 begin
  197.                 end;
  198.             1026:            {  Row 4, Column 2 }
  199.                 begin
  200.                 end;
  201.             1281:            {  Row 5, Column 1 }
  202.                 begin
  203.                 end;
  204.             1282:            {  Row 5, Column 2 }
  205.                 begin
  206.                 end;
  207.             1537:            {  Row 6, Column 1 }
  208.                 begin
  209.                 end;
  210.             1538:            {  Row 6, Column 2 }
  211.                 begin
  212.                 end;
  213.             1793:            {  Row 7, Column 1 }
  214.                 begin
  215.                 end;
  216.             1794:            {  Row 7, Column 2 }
  217.                 begin
  218.                 end;
  219.             2049:            {  Row 8, Column 1 }
  220.                 begin
  221.                 end;
  222.             2050:            {  Row 8, Column 2 }
  223.                 begin
  224.                 end;
  225.             2305:            {  Row 9, Column 1 }
  226.                 begin
  227.                 end;
  228.             2306:            {  Row 9, Column 2 }
  229.                 begin
  230.                 end;
  231.             2561:            {  Row 10, Column 1 }
  232.                 begin
  233.                 end;
  234.             2562:            {  Row 10, Column 2 }
  235.                 begin
  236.                 end;
  237.  
  238.             otherwise                            { allow other buttons, trap for debug }
  239.                 begin
  240.                 end;
  241.             end;                                    { end of switch }
  242.         end;
  243.  
  244.  
  245.     otherwise                                    { allow other buttons, trap for debug }
  246.         begin
  247.         end;
  248.     end;                                            { end of switch }
  249.  
  250. end;
  251.  
  252. { ======================================================= }
  253.  
  254. { Routine: U_DoEventFloating_window }
  255. { Purpose: Handle any special window events }
  256.  
  257. procedure U_DoEventFloating_window(theWS:Floating_windowPRec;var myEvent:EventRecord);
  258.  
  259.  
  260. begin
  261. end;
  262.  
  263. { ======================================================= }
  264. { ======================================================= }
  265. end.
  266.